<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
    xmlns:rich="http://richfaces.org/rich">
    
    	<rich:panel styleClass="rich-panel-filtro">
        	 <rich:panel style="border-color: white;">
	        	 <table>
	        	 	    <tr>
					       	<h:commandButton  image="/img/logoAna.png"/>
	        	 	    </tr>
		        	 	<tr>
			        	 	<td><h:outputText value="Porcentagem do Período Chuvoso:" /></td>
			        	 	<td>
			        	 		<h:inputText value="#{restricoes.porcentagemPeriodoChuvoso}" id="periodoChuvoso" size="1" maxlength="3" required="true"/>%
			        	 		<rich:message for="periodoChuvoso">
			                        <f:facet name="errorMarker">
			                            <h:graphicImage value="/img/error.gif" />   
			                        </f:facet>
			                    </rich:message>
			        	 	</td>
		        	 	</tr>
		        	 	
		        	 	<tr>
			        		<td><h:outputText value="Quantidade de dias Acumulados:" /></td>
			        	 	<td>
			        	 		<h:inputText value="#{restricoes.qtDiasAcumulados}" id="diasAcumulados" size="1" required="true"/>dias
			        	 		<rich:message for="diasAcumulados">
			                        <f:facet name="errorMarker">
			                            <h:graphicImage value="/img/error.gif" />   
			                        </f:facet>
			                    </rich:message>
			        	 	</td>
		        	 	</tr>
		        	 	
						<tr>
			        	 	<td><h:outputText value="Quantidade de Anos do Historico:" /></td>
			        	 	<td>
			        	 		<h:inputText value="#{restricoes.numeroAnosHistorico}" id="anosHistorico" size="1" required="true"/>anos
			        	 		<rich:message for="anosHistorico">
			                        <f:facet name="errorMarker">
			                            <h:graphicImage value="/img/error.gif" />   
			                        </f:facet>
			                    </rich:message>
			                </td>
						</tr>

	        	 		<tr>
		        	 		<td><h:outputText value="Informe o Número da Estação:" /></td>
		        	 		<td>
		        	 			<h:inputText id="estacaoNome" value="#{chuvaAction.estacao}" size="10" required="true">
		        	 			</h:inputText>
		        	 			<rich:message for="estacaoNome">
			                        <f:facet name="errorMarker">
			                            <h:graphicImage value="/img/error.gif" />   
			                        </f:facet>
			                    </rich:message>
		        	 		</td>
			        	 	<td>
			        	 		<a4j:commandButton action="#{chuvaAction.carregarChuvas}" image="/img/search.png" 
			        	 							reRender="listaChuvasEntity1, listaChuvasEntity2, txtMedia, txtDesvioPadrao, listaChuvasEntity3, listaChuvasEntity4, txtCalculoParcial, txtCoeficienteAssimetria, precipitacaoExtrema">
				        	 		<a4j:status id="loading"  
									            onstart="Richfaces.showModalPanel('panel_loading')"   
									            onstop="Richfaces.hideModalPanel('panel_loading')" >  
						        	</a4j:status>
				        	 	</a4j:commandButton>
			        	 	</td>
			        	 	
		        	 	</tr>
		        	 	<tr>
			        	 	<td>
			        	 		<a4j:commandButton action="#{chuvaAction.carregarPeriodoChuvoso}" value="Carregar Período"
			        	 							reRender="listaChuvasEntity1, listaChuvasEntity2, txtMedia, txtDesvioPadrao, listaChuvasEntity3, listaChuvasEntity4, txtCalculoParcial, txtCoeficienteAssimetria, precipitacaoExtrema">
		        	 			</a4j:commandButton>
			        	 	</td>
			        	</tr>
	        	 </table>	
        	 </rich:panel>
        </rich:panel>
        
        <div style="float:right">
   			<ui:include src="/TabPanel.xhtml" />
   		</div>
   		
        <rich:panel styleClass="rich-panel-filtro">
        	 <rich:panel style="border-color: white;">
	        	 <table>
	        	 	<tr>
	        	 		<td><h:outputText value="Resultados:" style="font-weight: bold;font-size:18px;text-decoration: underline;"/></td>
	        	 	</tr>
	        	 	<tr>
	        	 		<td><h:outputText value="Média das Chuvas:" style="font-weight: bold;"/></td>
	        	 		<td>
	        	 			<h:outputText id="txtMedia" value="#{chuvaAction.media}">
	        	 				<f:convertNumber maxFractionDigits="1" />
	        	 			</h:outputText>
	        	 		</td>
	        	 	</tr>
	        	 	
	        	 	<tr>
	        	 		<td><h:outputText value="Desvio Padrão:" style="font-weight: bold;"/></td>
	        	 		<td>
	        	 			<h:outputText id="txtDesvioPadrao" value="#{chuvaAction.desvioPadrao}">
	        	 				<f:convertNumber maxFractionDigits="1" />
	        	 			</h:outputText>
	        	 		</td>
	        	 	</tr>
	        	 	
	        	 	<tr>
	        	 		<td><h:outputText value="Cálculo Parcial:" style="font-weight: bold;"/></td>
	        	 		<td>
	        	 			<h:outputText id="txtCalculoParcial" value="#{resultados.calculoParcial}">
	        	 				<f:convertNumber maxFractionDigits="5" />
	        	 			</h:outputText>
	        	 		</td>
	        	 	</tr>
	        	 	
	        	 	<tr>
	        	 		<td><h:outputText value="Coeficiente de Assimetria:" style="font-weight: bold;"/></td>
	        	 		<td>
	        	 			<h:outputText id="txtCoeficienteAssimetria" value="#{resultados.coeficienteAssimetria}" style="color:red;font-weight: bold;">
	        	 				<f:convertNumber maxFractionDigits="4" />
	        	 			</h:outputText>
	        	 		</td>
	        	 	</tr>
	        	 	<tr>
	        	 		<td></td>
	        	 	</tr>
	        	 	<tr>
	        	 		<td><h:outputText value="Legenda:" style="font-weight: bold;font-size:15px;text-decoration: underline;"/></td>
	        	 	</tr>
	        	 	<tr>
	        	 		<td><h:outputText value="Xi = Dado amostral"/></td>
	        	 	</tr>
	        	 	<tr>
	        	 		<td><h:outputText value="Xmed = Média aritmética da amostra"/></td>
	        	 	</tr>
	        	 	<tr>
	        	 		<td><h:outputText value="DP = Desvio padrão da amostra"/></td>
	        	 	</tr>
	        	 	<tr>
	        	 		<td><h:outputText value="N = nº de elementos da amostra"/></td>
	        	 	</tr>
	        	 </table>	
        	 </rich:panel>
        </rich:panel>
   		
   		<rich:modalPanel id="panel_loading" autosized="true">
			<h:graphicImage url="/img/loading.gif" style="border:0px; vertical-align: middle;" />
				<rich:spacer width="20" /><br/>
				<h:outputText value="Carregando... Aguarde!" />
		</rich:modalPanel>
		
</ui:composition>    